package com.gisocn.onemap.base;

import android.content.Context;
import android.view.LayoutInflater;
import com.gisocn.onemap.interfaces.ItemViewDelegate;
import java.util.List;

/* loaded from: classes.dex */
public abstract class CommonAdapter<T> extends MultiItemTypeAdapter<T> {
    protected Context mContext;
    protected List<T> mDatas;
    protected LayoutInflater mInflater;
    protected int mLayoutId;

    protected abstract void convert(ViewHolder viewHolder, T t, int i);

    public CommonAdapter(Context context, final int i, List<T> list) {
        super(context, list);
        this.mContext = context;
        this.mInflater = LayoutInflater.from(context);
        this.mLayoutId = i;
        this.mDatas = list;
        addItemViewDelegate(new ItemViewDelegate<T>() { // from class: com.gisocn.onemap.base.CommonAdapter.1
            @Override // com.gisocn.onemap.interfaces.ItemViewDelegate
            public boolean isForViewType(T t, int i2) {
                return true;
            }

            @Override // com.gisocn.onemap.interfaces.ItemViewDelegate
            public int getItemViewLayoutId() {
                return i;
            }

            @Override // com.gisocn.onemap.interfaces.ItemViewDelegate
            public void convert(ViewHolder viewHolder, T t, int i2) {
                CommonAdapter.this.convert(viewHolder, t, i2);
            }
        });
    }
}
